package derfer

import "fmt"

func Deferer() {
	var fs = [4]func(){}
	var fslen = len(fs)
	for i := 0; i < fslen; i++ {
		defer fmt.Println("defer i =", i)
		defer func() { fmt.Println("defer_closure i = ", i) }()
		fs[i] = func() {
			fmt.Println("closure i=", i)
		}
	}
	for _, f := range fs {
		f()
	}
}
